package p07.p0718;

import java.util.Scanner;

/**
 * Created by wy on 7/17/2017.
 */
class ChangFangXing {
    private int chang;
    private int kuan;

    public int getChang() {
        return chang;
    }

    public void setChang(int chang) {
        this.chang = chang;
    }

    public int getKuan() {
        return kuan;
    }

    public void setKuan(int kuan) {
        this.kuan = kuan;
    }

    public int zhouchang() {
        return (chang + kuan) * 2;
    }

    public int mianji() {
        return chang * kuan;
    }
}

class Test {
    public static void main(String[] args) {
        ChangFangXing changFangXing = new ChangFangXing();
        //changFangXing.setChang(23);
        //changFangXing.setKuan(44);
        Scanner scanner = new Scanner(System.in);
        System.out.println("in put chang:");
        int chang = scanner.nextInt();
        System.out.println("in put kuan:");
        int kuan = scanner.nextInt();

        changFangXing.setChang(chang);
        changFangXing.setKuan(kuan);
        int zhouchang = changFangXing.zhouchang();
        int mianji = changFangXing.mianji();

        System.out.println("周长：" + zhouchang);
        System.out.println("面积：" + mianji);
    }

}